package com.freeman.boot;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by freeman on 16-1-21.
 */
@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {

    private static final Logger LOGGER = LoggerFactory.getLogger(WebConfiguration.class);
    /**
     * static resources
     * */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        LOGGER.info("设置静态文件路径！");
        registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/assets/");/* --必须要带最后的/-- */
    }
}
